   <include file="Public:top" /> 
	</head>
  
	<body>
    
    <div id="body-wrapper" > <!-- Wrapper for the radial gradient background -->		

        <!--left start-->
		
        <include file="Public:left" /> 
        <!--left end-->
        
        
        <!-- End #sidebar -->			
		<div id="main-content"> <!-- Main Content Section with everything -->
        <div  id="header_logo">{:C("SITE_INFO.name")}</div>	 		
			
			<!-- Page Head -->
			<div style="float:left;">
              <h2><if condition="tep_not_null($listInfo['id'])">{$listInfo.name} <else /> 新增热门城市</if></h2>
            </div>
			<div class="clear"></div> <!-- End .clear -->           
                <!-- Insert -->
                <form action="{:U($action)}" name="editForm" method="post" enctype="multipart/form-data" >
                 <input type="hidden" name="editId" value="{$editId}" >		
                <div class="content-box">				
                    <div class="content-box-header"> 
                    	 <ul class="content-box-tabs">			
                                      
                              <li><a href="#tab1" id="menu1" class="default-tab current" style="text-transform:capitalize">选择热门城市</a></li>		       
                                                          
                          </ul>	 
                         <span class="insert" style=" float:right; line-height:40px; font-size:14px; font-weight:bold;"><a href="{:U('index')}">List </a>&nbsp; &nbsp; </span>                        	
                      <div class="clear"></div>					
                    </div>
                    <!-- 社区筛选条件 超级管理员组 与 普通管理员组-->
    

   省份：
    <select id="cname" name="provcode" autocomplete="off"> 
        <option value="-1">请选择省份</option>
        <foreach name="allProvince" item="vo">
        <option value="{$vo.code}" <if condition="$provcode eq $vo['code']">selected="selected"</if>>{$vo.name}</option> 
        </foreach>
    </select> 
    城市：
    <select id="qname" name="citycode" autocomplete="off"> 
        <option value="-1">请选择城市</option>
        <foreach name="allCity" item="vo">
        <option value="{$vo.code}" <if condition="$citycode eq $vo['code']">selected="selected"</if> >{$vo.name}</option> 
        </foreach>
    </select> 
  
    <script>
    $(document).ready(function(){
        // 初始时的控件的值
        var cityId = $("#cname").val();
        var areaId = $("#qname").val();
       
        //城市
        var allProvince = eval('{$e_allProvince}');
        var allCity = eval('{$e_allCity}');
   
        var html = "";

        function ref_component_base(curr_change_id, title, each_var, b_id, curr_id, html_val, op_attr_id, op_attr_name){
            if (curr_change_id != '-1') {
                // 区域
                html = "<option value='-1'>" + title + "</option>";
                $.each(each_var, function(a,b){
                    if (b[b_id] == curr_change_id) {
                        if ( curr_id != '-1' && curr_id == b[op_attr_id] ) {
                            html += "<option value='" + b[op_attr_id] + "' selected='selected'>" + b[op_attr_name] + "</option>"
                        } else {
                            html += "<option value='" + b[op_attr_id] + "'>" + b[op_attr_name] + "</option>"
                        }
                    };
                });
                $("#" + html_val).html(html);
            } else {
                html = "<option value='-1'>" + title + "</option>";
                $("#" + html_val).html(html);
            }
        }

        function ref_component(){
            ref_component_base(cityId, "请选择城市", allCity, 'provincecode', areaId, "qname", 'code', 'name');
           // ref_component_base(areaId, "请选择分区", allArea, 'citycode', streetId, "jname", 'code', 'name');
        }

        ref_component();
        
        // 城市有变化
        $("#cname").bind("change",function(){ 
            cityId = $("#cname").val();
            areaId = '-1';
            streetId = '-1';
            shequId = '-1';
            ref_component();
        });

      
    });

    </script>
                 
                
                </div>                 
                <!--End Insert -->
                 <div class="clear"></div>
                            <input class="button" style="text-transform:capitalize" type="submit" name="BtnSave"  value="{$actionName}" />&nbsp;&nbsp;
                            <input class="button" type="button" name="back" onClick="window.location.href='{:U('index')}'"  value="Back" />    
			</form>
			
			<div class="clear"></div>
			
			
			<!-- Start Notifications -->
			
			

			
			<!-- End Notifications -->
			
            <div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						&#169; Copyright 2013
				</small>
			</div>
			
			
			
			<!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div>
	
	
	
	</body>
<!-- Download From www.exet.tk-->
</html>

		

